// 车险集印
import Vue from 'vue'
import carIndia from '@/components/ivew_components/car_india/index.vue'
import {store} from '@/store/index'
import commonFn from './common_fn.ts'

const vueObj:any = new Vue()

const conf = {
    title: '开始集印',
    icon: 'icon-resource',
    pag: 'carIndia',
    fn (){  

        vueObj.$Modal.confirm({
            okText: '集印完成',
            cancelText: '关闭窗口',
            width: 800,
            
            onOk (){

                store.dispatch('request', {
                    url: 'patch/order/id/status',
                    data: {
                        currentAction: '设置为已集印'
                    }
                }).then(success =>{

                    // 关闭折叠窗    
                    if(success){
                        setTimeout(() =>{
                            commonFn('updateTable','outForm')
                        }, 500)
                    }
                    
                })
                
            },
            render (h){
                
                return h(carIndia, {})
            }
        })
        
        
    } 
}

export default conf